package com.hs.sfzy.controller;

import com.hs.sfzy.entity.CompanyInfo;
import com.hs.sfzy.service.CompanyInfoService;
import com.hs.sfzy.until.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/companyInfo")
public class CompanyInfoController {
    @Autowired
    private CompanyInfoService companyInfoService;
@GetMapping("/{id}")
    public R getCompanyInfoById(@PathVariable("id") Integer id){
   CompanyInfo companyInfo=companyInfoService.getCompanyInfoById(id);
   return companyInfo==null?R.fail():R.ok(companyInfo);
}
}
